package com.ruoyi.common.config;

/**
 * @author wuxiao
 * @Package com.ruoyi.common.config
 * @date 2025-09-16 16:04
 */
import com.ruoyi.common.utils.uuid.IdWorker;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class IdWorkerConfig {
    @Bean
    public IdWorker idWorker(@Value("${idworker.workerId:1}") long workerId,
                             @Value("${idworker.datacenterId:1}") long datacenterId) {
        return new IdWorker(workerId, datacenterId);
    }
}
